package com.example.myintenttest;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        Intent intent = getIntent();
        String str = intent.getStringExtra("myname");
        Log.i("myInfo","传递过来的名字为"+str);
    }
    public void doclick(View v){
        Intent intent = new Intent();
        intent.putExtra("backInfo","返回到第一个页面的数据");
        setResult(RESULT_OK,intent);
        finish();
    }

}